// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
//
//------------------------------------------------------------------------------
// This code was generated by google-apis-code-generator 1.5.1
//
//  Changes to this file may cause incorrect behavior and will be lost if
//  the code is regenerated.
//------------------------------------------------------------------------------
#include "google/calendar_api/calendar_service.h"

#include <string>
#include "googleapis/base/integral_types.h"
#include "googleapis/client/service/client_service.h"
#include "googleapis/client/service/service_request_pager.h"
#include "googleapis/client/util/date_time.h"
#include "googleapis/client/util/status.h"

#include "google/calendar_api/acl.h"
#include "google/calendar_api/acl_rule.h"
#include "google/calendar_api/calendar.h"
#include "google/calendar_api/calendar_list.h"
#include "google/calendar_api/calendar_list_entry.h"
#include "google/calendar_api/channel.h"
#include "google/calendar_api/colors.h"
#include "google/calendar_api/event.h"
#include "google/calendar_api/events.h"
#include "google/calendar_api/free_busy_request.h"
#include "google/calendar_api/free_busy_response.h"
#include "google/calendar_api/setting.h"
#include "google/calendar_api/settings.h"


#include "googleapis/client/data/data_reader.h"
#include "googleapis/client/transport/http_request.h"
#include "googleapis/client/transport/http_transport.h"
#include "googleapis/client/util/uri_utils.h"
#include "googleapis/strings/strcat.h"

namespace google_calendar_api {
using namespace googleapis;
const char CalendarService::googleapis_API_NAME[] = { "calendar" };

const char CalendarService::googleapis_API_VERSION[] = { "v3" };

const char CalendarService::googleapis_API_GENERATOR[] = {
  "google-apis-code-generator 1.5.1 / 0.1.5"};


const char CalendarService::SCOPES::CALENDAR[] = {"https://www.googleapis.com/auth/calendar"};

const char CalendarService::SCOPES::CALENDAR_READONLY[] = {"https://www.googleapis.com/auth/calendar.readonly"};
CalendarServiceBaseRequest::CalendarServiceBaseRequest(
      const client::ClientService* service,
      client::AuthorizationCredential* credential,
      client::HttpRequest::HttpMethod method,
      const string& uri_template)
    : client::ClientServiceRequest(
          service, credential, method, uri_template),
      alt_("json"),
      pretty_print_(true),
      _have_alt_(false),
      _have_fields_(false),
      _have_key_(false),
      _have_oauth_token_(false),
      _have_pretty_print_(false),
      _have_quota_user_(false),
      _have_user_ip_(false) {
}

CalendarServiceBaseRequest::~CalendarServiceBaseRequest() {
}

util::Status CalendarServiceBaseRequest::AppendVariable(
    const string& variable_name,
    const client::UriTemplateConfig& config,
    string* target) {
  return client::StatusInvalidArgument(
      StrCat("Unknown url variable='", variable_name, "'"));
}

util::Status CalendarServiceBaseRequest::AppendOptionalQueryParameters(
    string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_alt_) {
    StrAppend(target, sep, "alt=",
              client::CppValueToEscapedUrlValue(
                alt_));
    sep = "&";
  }
  if (_have_fields_) {
    StrAppend(target, sep, "fields=",
              client::CppValueToEscapedUrlValue(
                fields_));
    sep = "&";
  }
  if (_have_key_) {
    StrAppend(target, sep, "key=",
              client::CppValueToEscapedUrlValue(
                key_));
    sep = "&";
  }
  if (_have_oauth_token_) {
    StrAppend(target, sep, "oauth_token=",
              client::CppValueToEscapedUrlValue(
                oauth_token_));
    sep = "&";
  }
  if (_have_pretty_print_) {
    StrAppend(target, sep, "prettyPrint=",
              client::CppValueToEscapedUrlValue(
                pretty_print_));
    sep = "&";
  }
  if (_have_quota_user_) {
    StrAppend(target, sep, "quotaUser=",
              client::CppValueToEscapedUrlValue(
                quota_user_));
    sep = "&";
  }
  if (_have_user_ip_) {
    StrAppend(target, sep, "userIp=",
              client::CppValueToEscapedUrlValue(
                user_ip_));
    sep = "&";
  }
  return client::ClientServiceRequest
         ::AppendOptionalQueryParameters(target);
}


void CalendarServiceBaseRequest::AddJsonContentToRequest(
    const client::JsonCppData *content) {
  client::HttpRequest* _http_request_ = mutable_http_request();
  _http_request_->set_content_type(
        client::HttpRequest::ContentType_JSON);
  _http_request_->set_content_reader(content->MakeJsonReader());
}



// Standard constructor.
AclResource_DeleteMethod::AclResource_DeleteMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& rule_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::DELETE,
        "calendars/{calendarId}/acl/{ruleId}"),
      calendar_id_(calendar_id.as_string()),
      rule_id_(rule_id.as_string()) {
}

// Standard destructor.
AclResource_DeleteMethod::~AclResource_DeleteMethod() {
}


util::Status AclResource_DeleteMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "ruleId") {
    client::UriTemplate::AppendValue(
        rule_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
AclResource_GetMethod::AclResource_GetMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& rule_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "calendars/{calendarId}/acl/{ruleId}"),
      calendar_id_(calendar_id.as_string()),
      rule_id_(rule_id.as_string()) {
}

// Standard destructor.
AclResource_GetMethod::~AclResource_GetMethod() {
}


util::Status AclResource_GetMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "ruleId") {
    client::UriTemplate::AppendValue(
        rule_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
AclResource_InsertMethod::AclResource_InsertMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const AclRule& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars/{calendarId}/acl"),
      calendar_id_(calendar_id.as_string()),
      _have_send_notifications_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
AclResource_InsertMethod::~AclResource_InsertMethod() {
}

util::Status AclResource_InsertMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status AclResource_InsertMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
AclResource_ListMethod::AclResource_ListMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "calendars/{calendarId}/acl"),
      calendar_id_(calendar_id.as_string()),
      _have_max_results_(false),
      _have_page_token_(false),
      _have_show_deleted_(false),
      _have_sync_token_(false) {
}

// Standard destructor.
AclResource_ListMethod::~AclResource_ListMethod() {
}

util::Status AclResource_ListMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_show_deleted_) {
    StrAppend(target, sep, "showDeleted=",
              client::CppValueToEscapedUrlValue(
                show_deleted_));
    sep = "&";
  }
  if (_have_sync_token_) {
    StrAppend(target, sep, "syncToken=",
              client::CppValueToEscapedUrlValue(
                sync_token_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status AclResource_ListMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
AclResource_PatchMethod::AclResource_PatchMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& rule_id, const AclRule& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::PATCH,
        "calendars/{calendarId}/acl/{ruleId}"),
      calendar_id_(calendar_id.as_string()),
      rule_id_(rule_id.as_string()),
      _have_send_notifications_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
AclResource_PatchMethod::~AclResource_PatchMethod() {
}

util::Status AclResource_PatchMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status AclResource_PatchMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "ruleId") {
    client::UriTemplate::AppendValue(
        rule_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
AclResource_UpdateMethod::AclResource_UpdateMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& rule_id, const AclRule& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::PUT,
        "calendars/{calendarId}/acl/{ruleId}"),
      calendar_id_(calendar_id.as_string()),
      rule_id_(rule_id.as_string()),
      _have_send_notifications_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
AclResource_UpdateMethod::~AclResource_UpdateMethod() {
}

util::Status AclResource_UpdateMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status AclResource_UpdateMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "ruleId") {
    client::UriTemplate::AppendValue(
        rule_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
AclResource_WatchMethod::AclResource_WatchMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Channel& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars/{calendarId}/acl/watch"),
      calendar_id_(calendar_id.as_string()),
      _have_max_results_(false),
      _have_page_token_(false),
      _have_show_deleted_(false),
      _have_sync_token_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
AclResource_WatchMethod::~AclResource_WatchMethod() {
}

util::Status AclResource_WatchMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_show_deleted_) {
    StrAppend(target, sep, "showDeleted=",
              client::CppValueToEscapedUrlValue(
                show_deleted_));
    sep = "&";
  }
  if (_have_sync_token_) {
    StrAppend(target, sep, "syncToken=",
              client::CppValueToEscapedUrlValue(
                sync_token_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status AclResource_WatchMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarListResource_DeleteMethod::CalendarListResource_DeleteMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::DELETE,
        "users/me/calendarList/{calendarId}"),
      calendar_id_(calendar_id.as_string()) {
}

// Standard destructor.
CalendarListResource_DeleteMethod::~CalendarListResource_DeleteMethod() {
}


util::Status CalendarListResource_DeleteMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarListResource_GetMethod::CalendarListResource_GetMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "users/me/calendarList/{calendarId}"),
      calendar_id_(calendar_id.as_string()) {
}

// Standard destructor.
CalendarListResource_GetMethod::~CalendarListResource_GetMethod() {
}


util::Status CalendarListResource_GetMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarListResource_InsertMethod::CalendarListResource_InsertMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const CalendarListEntry& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "users/me/calendarList"),
      _have_color_rgb_format_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
CalendarListResource_InsertMethod::~CalendarListResource_InsertMethod() {
}

util::Status CalendarListResource_InsertMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_color_rgb_format_) {
    StrAppend(target, sep, "colorRgbFormat=",
              client::CppValueToEscapedUrlValue(
                color_rgb_format_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status CalendarListResource_InsertMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarListResource_ListMethod::CalendarListResource_ListMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "users/me/calendarList"),
      _have_max_results_(false),
      _have_min_access_role_(false),
      _have_page_token_(false),
      _have_show_deleted_(false),
      _have_show_hidden_(false),
      _have_sync_token_(false) {
}

// Standard destructor.
CalendarListResource_ListMethod::~CalendarListResource_ListMethod() {
}

util::Status CalendarListResource_ListMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_min_access_role_) {
    StrAppend(target, sep, "minAccessRole=",
              client::CppValueToEscapedUrlValue(
                min_access_role_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_show_deleted_) {
    StrAppend(target, sep, "showDeleted=",
              client::CppValueToEscapedUrlValue(
                show_deleted_));
    sep = "&";
  }
  if (_have_show_hidden_) {
    StrAppend(target, sep, "showHidden=",
              client::CppValueToEscapedUrlValue(
                show_hidden_));
    sep = "&";
  }
  if (_have_sync_token_) {
    StrAppend(target, sep, "syncToken=",
              client::CppValueToEscapedUrlValue(
                sync_token_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status CalendarListResource_ListMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarListResource_PatchMethod::CalendarListResource_PatchMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const CalendarListEntry& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::PATCH,
        "users/me/calendarList/{calendarId}"),
      calendar_id_(calendar_id.as_string()),
      _have_color_rgb_format_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
CalendarListResource_PatchMethod::~CalendarListResource_PatchMethod() {
}

util::Status CalendarListResource_PatchMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_color_rgb_format_) {
    StrAppend(target, sep, "colorRgbFormat=",
              client::CppValueToEscapedUrlValue(
                color_rgb_format_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status CalendarListResource_PatchMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarListResource_UpdateMethod::CalendarListResource_UpdateMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const CalendarListEntry& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::PUT,
        "users/me/calendarList/{calendarId}"),
      calendar_id_(calendar_id.as_string()),
      _have_color_rgb_format_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
CalendarListResource_UpdateMethod::~CalendarListResource_UpdateMethod() {
}

util::Status CalendarListResource_UpdateMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_color_rgb_format_) {
    StrAppend(target, sep, "colorRgbFormat=",
              client::CppValueToEscapedUrlValue(
                color_rgb_format_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status CalendarListResource_UpdateMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarListResource_WatchMethod::CalendarListResource_WatchMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const Channel& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "users/me/calendarList/watch"),
      _have_max_results_(false),
      _have_min_access_role_(false),
      _have_page_token_(false),
      _have_show_deleted_(false),
      _have_show_hidden_(false),
      _have_sync_token_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
CalendarListResource_WatchMethod::~CalendarListResource_WatchMethod() {
}

util::Status CalendarListResource_WatchMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_min_access_role_) {
    StrAppend(target, sep, "minAccessRole=",
              client::CppValueToEscapedUrlValue(
                min_access_role_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_show_deleted_) {
    StrAppend(target, sep, "showDeleted=",
              client::CppValueToEscapedUrlValue(
                show_deleted_));
    sep = "&";
  }
  if (_have_show_hidden_) {
    StrAppend(target, sep, "showHidden=",
              client::CppValueToEscapedUrlValue(
                show_hidden_));
    sep = "&";
  }
  if (_have_sync_token_) {
    StrAppend(target, sep, "syncToken=",
              client::CppValueToEscapedUrlValue(
                sync_token_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status CalendarListResource_WatchMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarsResource_ClearMethod::CalendarsResource_ClearMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars/{calendarId}/clear"),
      calendar_id_(calendar_id.as_string()) {
}

// Standard destructor.
CalendarsResource_ClearMethod::~CalendarsResource_ClearMethod() {
}


util::Status CalendarsResource_ClearMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarsResource_DeleteMethod::CalendarsResource_DeleteMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::DELETE,
        "calendars/{calendarId}"),
      calendar_id_(calendar_id.as_string()) {
}

// Standard destructor.
CalendarsResource_DeleteMethod::~CalendarsResource_DeleteMethod() {
}


util::Status CalendarsResource_DeleteMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarsResource_GetMethod::CalendarsResource_GetMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "calendars/{calendarId}"),
      calendar_id_(calendar_id.as_string()) {
}

// Standard destructor.
CalendarsResource_GetMethod::~CalendarsResource_GetMethod() {
}


util::Status CalendarsResource_GetMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarsResource_InsertMethod::CalendarsResource_InsertMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const Calendar& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars") {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
CalendarsResource_InsertMethod::~CalendarsResource_InsertMethod() {
}


// Standard constructor.
CalendarsResource_PatchMethod::CalendarsResource_PatchMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Calendar& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::PATCH,
        "calendars/{calendarId}"),
      calendar_id_(calendar_id.as_string()) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
CalendarsResource_PatchMethod::~CalendarsResource_PatchMethod() {
}


util::Status CalendarsResource_PatchMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
CalendarsResource_UpdateMethod::CalendarsResource_UpdateMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Calendar& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::PUT,
        "calendars/{calendarId}"),
      calendar_id_(calendar_id.as_string()) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
CalendarsResource_UpdateMethod::~CalendarsResource_UpdateMethod() {
}


util::Status CalendarsResource_UpdateMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
ChannelsResource_StopMethod::ChannelsResource_StopMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const Channel& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "channels/stop") {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
ChannelsResource_StopMethod::~ChannelsResource_StopMethod() {
}


// Standard constructor.
ColorsResource_GetMethod::ColorsResource_GetMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "colors") {
}

// Standard destructor.
ColorsResource_GetMethod::~ColorsResource_GetMethod() {
}


// Standard constructor.
EventsResource_DeleteMethod::EventsResource_DeleteMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::DELETE,
        "calendars/{calendarId}/events/{eventId}"),
      calendar_id_(calendar_id.as_string()),
      event_id_(event_id.as_string()),
      _have_send_notifications_(false) {
}

// Standard destructor.
EventsResource_DeleteMethod::~EventsResource_DeleteMethod() {
}

util::Status EventsResource_DeleteMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_DeleteMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "eventId") {
    client::UriTemplate::AppendValue(
        event_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_GetMethod::EventsResource_GetMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "calendars/{calendarId}/events/{eventId}"),
      calendar_id_(calendar_id.as_string()),
      event_id_(event_id.as_string()),
      _have_always_include_email_(false),
      _have_max_attendees_(false),
      _have_time_zone_(false) {
}

// Standard destructor.
EventsResource_GetMethod::~EventsResource_GetMethod() {
}

util::Status EventsResource_GetMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_always_include_email_) {
    StrAppend(target, sep, "alwaysIncludeEmail=",
              client::CppValueToEscapedUrlValue(
                always_include_email_));
    sep = "&";
  }
  if (_have_max_attendees_) {
    StrAppend(target, sep, "maxAttendees=",
              client::CppValueToEscapedUrlValue(
                max_attendees_));
    sep = "&";
  }
  if (_have_time_zone_) {
    StrAppend(target, sep, "timeZone=",
              client::CppValueToEscapedUrlValue(
                time_zone_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_GetMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "eventId") {
    client::UriTemplate::AppendValue(
        event_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_ImportMethod::EventsResource_ImportMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Event& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars/{calendarId}/events/import"),
      calendar_id_(calendar_id.as_string()),
      _have_supports_attachments_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
EventsResource_ImportMethod::~EventsResource_ImportMethod() {
}

util::Status EventsResource_ImportMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_supports_attachments_) {
    StrAppend(target, sep, "supportsAttachments=",
              client::CppValueToEscapedUrlValue(
                supports_attachments_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_ImportMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_InsertMethod::EventsResource_InsertMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Event& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars/{calendarId}/events"),
      calendar_id_(calendar_id.as_string()),
      _have_max_attendees_(false),
      _have_send_notifications_(false),
      _have_supports_attachments_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
EventsResource_InsertMethod::~EventsResource_InsertMethod() {
}

util::Status EventsResource_InsertMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_max_attendees_) {
    StrAppend(target, sep, "maxAttendees=",
              client::CppValueToEscapedUrlValue(
                max_attendees_));
    sep = "&";
  }
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  if (_have_supports_attachments_) {
    StrAppend(target, sep, "supportsAttachments=",
              client::CppValueToEscapedUrlValue(
                supports_attachments_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_InsertMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_InstancesMethod::EventsResource_InstancesMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "calendars/{calendarId}/events/{eventId}/instances"),
      calendar_id_(calendar_id.as_string()),
      event_id_(event_id.as_string()),
      _have_always_include_email_(false),
      _have_max_attendees_(false),
      _have_max_results_(false),
      _have_original_start_(false),
      _have_page_token_(false),
      _have_show_deleted_(false),
      _have_time_max_(false),
      _have_time_min_(false),
      _have_time_zone_(false) {
}

// Standard destructor.
EventsResource_InstancesMethod::~EventsResource_InstancesMethod() {
}

util::Status EventsResource_InstancesMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_always_include_email_) {
    StrAppend(target, sep, "alwaysIncludeEmail=",
              client::CppValueToEscapedUrlValue(
                always_include_email_));
    sep = "&";
  }
  if (_have_max_attendees_) {
    StrAppend(target, sep, "maxAttendees=",
              client::CppValueToEscapedUrlValue(
                max_attendees_));
    sep = "&";
  }
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_original_start_) {
    StrAppend(target, sep, "originalStart=",
              client::CppValueToEscapedUrlValue(
                original_start_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_show_deleted_) {
    StrAppend(target, sep, "showDeleted=",
              client::CppValueToEscapedUrlValue(
                show_deleted_));
    sep = "&";
  }
  if (_have_time_max_) {
    StrAppend(target, sep, "timeMax=",
              client::CppValueToEscapedUrlValue(
                time_max_));
    sep = "&";
  }
  if (_have_time_min_) {
    StrAppend(target, sep, "timeMin=",
              client::CppValueToEscapedUrlValue(
                time_min_));
    sep = "&";
  }
  if (_have_time_zone_) {
    StrAppend(target, sep, "timeZone=",
              client::CppValueToEscapedUrlValue(
                time_zone_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_InstancesMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "eventId") {
    client::UriTemplate::AppendValue(
        event_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_ListMethod::EventsResource_ListMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "calendars/{calendarId}/events"),
      calendar_id_(calendar_id.as_string()),
      max_results_(250),
      _have_always_include_email_(false),
      _have_i_cal_uid_(false),
      _have_max_attendees_(false),
      _have_max_results_(false),
      _have_order_by_(false),
      _have_page_token_(false),
      _have_private_extended_property_(false),
      _have_q_(false),
      _have_shared_extended_property_(false),
      _have_show_deleted_(false),
      _have_show_hidden_invitations_(false),
      _have_single_events_(false),
      _have_sync_token_(false),
      _have_time_max_(false),
      _have_time_min_(false),
      _have_time_zone_(false),
      _have_updated_min_(false) {
}

// Standard destructor.
EventsResource_ListMethod::~EventsResource_ListMethod() {
}

util::Status EventsResource_ListMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_always_include_email_) {
    StrAppend(target, sep, "alwaysIncludeEmail=",
              client::CppValueToEscapedUrlValue(
                always_include_email_));
    sep = "&";
  }
  if (_have_i_cal_uid_) {
    StrAppend(target, sep, "iCalUID=",
              client::CppValueToEscapedUrlValue(
                i_cal_uid_));
    sep = "&";
  }
  if (_have_max_attendees_) {
    StrAppend(target, sep, "maxAttendees=",
              client::CppValueToEscapedUrlValue(
                max_attendees_));
    sep = "&";
  }
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_order_by_) {
    StrAppend(target, sep, "orderBy=",
              client::CppValueToEscapedUrlValue(
                order_by_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_private_extended_property_) {
    if (!private_extended_property_.empty()) {
      target->append(sep);
      client::AppendIteratorToUrl(
        private_extended_property_.begin(), private_extended_property_.end(),
        "privateExtendedProperty", target);
      sep = "&";
    }
  }
  if (_have_q_) {
    StrAppend(target, sep, "q=",
              client::CppValueToEscapedUrlValue(
                q_));
    sep = "&";
  }
  if (_have_shared_extended_property_) {
    if (!shared_extended_property_.empty()) {
      target->append(sep);
      client::AppendIteratorToUrl(
        shared_extended_property_.begin(), shared_extended_property_.end(),
        "sharedExtendedProperty", target);
      sep = "&";
    }
  }
  if (_have_show_deleted_) {
    StrAppend(target, sep, "showDeleted=",
              client::CppValueToEscapedUrlValue(
                show_deleted_));
    sep = "&";
  }
  if (_have_show_hidden_invitations_) {
    StrAppend(target, sep, "showHiddenInvitations=",
              client::CppValueToEscapedUrlValue(
                show_hidden_invitations_));
    sep = "&";
  }
  if (_have_single_events_) {
    StrAppend(target, sep, "singleEvents=",
              client::CppValueToEscapedUrlValue(
                single_events_));
    sep = "&";
  }
  if (_have_sync_token_) {
    StrAppend(target, sep, "syncToken=",
              client::CppValueToEscapedUrlValue(
                sync_token_));
    sep = "&";
  }
  if (_have_time_max_) {
    StrAppend(target, sep, "timeMax=",
              client::CppValueToEscapedUrlValue(
                time_max_));
    sep = "&";
  }
  if (_have_time_min_) {
    StrAppend(target, sep, "timeMin=",
              client::CppValueToEscapedUrlValue(
                time_min_));
    sep = "&";
  }
  if (_have_time_zone_) {
    StrAppend(target, sep, "timeZone=",
              client::CppValueToEscapedUrlValue(
                time_zone_));
    sep = "&";
  }
  if (_have_updated_min_) {
    StrAppend(target, sep, "updatedMin=",
              client::CppValueToEscapedUrlValue(
                updated_min_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_ListMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_MoveMethod::EventsResource_MoveMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id, const StringPiece& destination)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars/{calendarId}/events/{eventId}/move"),
      calendar_id_(calendar_id.as_string()),
      event_id_(event_id.as_string()),
      destination_(destination.as_string()),
      _have_send_notifications_(false) {
}

// Standard destructor.
EventsResource_MoveMethod::~EventsResource_MoveMethod() {
}

util::Status EventsResource_MoveMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
    StrAppend(target, sep, "destination=",
              client::CppValueToEscapedUrlValue(
                destination_));
    sep = "&";
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_MoveMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "eventId") {
    client::UriTemplate::AppendValue(
        event_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_PatchMethod::EventsResource_PatchMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id, const Event& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::PATCH,
        "calendars/{calendarId}/events/{eventId}"),
      calendar_id_(calendar_id.as_string()),
      event_id_(event_id.as_string()),
      _have_always_include_email_(false),
      _have_max_attendees_(false),
      _have_send_notifications_(false),
      _have_supports_attachments_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
EventsResource_PatchMethod::~EventsResource_PatchMethod() {
}

util::Status EventsResource_PatchMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_always_include_email_) {
    StrAppend(target, sep, "alwaysIncludeEmail=",
              client::CppValueToEscapedUrlValue(
                always_include_email_));
    sep = "&";
  }
  if (_have_max_attendees_) {
    StrAppend(target, sep, "maxAttendees=",
              client::CppValueToEscapedUrlValue(
                max_attendees_));
    sep = "&";
  }
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  if (_have_supports_attachments_) {
    StrAppend(target, sep, "supportsAttachments=",
              client::CppValueToEscapedUrlValue(
                supports_attachments_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_PatchMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "eventId") {
    client::UriTemplate::AppendValue(
        event_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_QuickAddMethod::EventsResource_QuickAddMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& text)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars/{calendarId}/events/quickAdd"),
      calendar_id_(calendar_id.as_string()),
      text_(text.as_string()),
      _have_send_notifications_(false) {
}

// Standard destructor.
EventsResource_QuickAddMethod::~EventsResource_QuickAddMethod() {
}

util::Status EventsResource_QuickAddMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
    StrAppend(target, sep, "text=",
              client::CppValueToEscapedUrlValue(
                text_));
    sep = "&";
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_QuickAddMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_UpdateMethod::EventsResource_UpdateMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id, const Event& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::PUT,
        "calendars/{calendarId}/events/{eventId}"),
      calendar_id_(calendar_id.as_string()),
      event_id_(event_id.as_string()),
      _have_always_include_email_(false),
      _have_max_attendees_(false),
      _have_send_notifications_(false),
      _have_supports_attachments_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
EventsResource_UpdateMethod::~EventsResource_UpdateMethod() {
}

util::Status EventsResource_UpdateMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_always_include_email_) {
    StrAppend(target, sep, "alwaysIncludeEmail=",
              client::CppValueToEscapedUrlValue(
                always_include_email_));
    sep = "&";
  }
  if (_have_max_attendees_) {
    StrAppend(target, sep, "maxAttendees=",
              client::CppValueToEscapedUrlValue(
                max_attendees_));
    sep = "&";
  }
  if (_have_send_notifications_) {
    StrAppend(target, sep, "sendNotifications=",
              client::CppValueToEscapedUrlValue(
                send_notifications_));
    sep = "&";
  }
  if (_have_supports_attachments_) {
    StrAppend(target, sep, "supportsAttachments=",
              client::CppValueToEscapedUrlValue(
                supports_attachments_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_UpdateMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  if (variable_name == "eventId") {
    client::UriTemplate::AppendValue(
        event_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
EventsResource_WatchMethod::EventsResource_WatchMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Channel& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "calendars/{calendarId}/events/watch"),
      calendar_id_(calendar_id.as_string()),
      max_results_(250),
      _have_always_include_email_(false),
      _have_i_cal_uid_(false),
      _have_max_attendees_(false),
      _have_max_results_(false),
      _have_order_by_(false),
      _have_page_token_(false),
      _have_private_extended_property_(false),
      _have_q_(false),
      _have_shared_extended_property_(false),
      _have_show_deleted_(false),
      _have_show_hidden_invitations_(false),
      _have_single_events_(false),
      _have_sync_token_(false),
      _have_time_max_(false),
      _have_time_min_(false),
      _have_time_zone_(false),
      _have_updated_min_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
EventsResource_WatchMethod::~EventsResource_WatchMethod() {
}

util::Status EventsResource_WatchMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_always_include_email_) {
    StrAppend(target, sep, "alwaysIncludeEmail=",
              client::CppValueToEscapedUrlValue(
                always_include_email_));
    sep = "&";
  }
  if (_have_i_cal_uid_) {
    StrAppend(target, sep, "iCalUID=",
              client::CppValueToEscapedUrlValue(
                i_cal_uid_));
    sep = "&";
  }
  if (_have_max_attendees_) {
    StrAppend(target, sep, "maxAttendees=",
              client::CppValueToEscapedUrlValue(
                max_attendees_));
    sep = "&";
  }
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_order_by_) {
    StrAppend(target, sep, "orderBy=",
              client::CppValueToEscapedUrlValue(
                order_by_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_private_extended_property_) {
    if (!private_extended_property_.empty()) {
      target->append(sep);
      client::AppendIteratorToUrl(
        private_extended_property_.begin(), private_extended_property_.end(),
        "privateExtendedProperty", target);
      sep = "&";
    }
  }
  if (_have_q_) {
    StrAppend(target, sep, "q=",
              client::CppValueToEscapedUrlValue(
                q_));
    sep = "&";
  }
  if (_have_shared_extended_property_) {
    if (!shared_extended_property_.empty()) {
      target->append(sep);
      client::AppendIteratorToUrl(
        shared_extended_property_.begin(), shared_extended_property_.end(),
        "sharedExtendedProperty", target);
      sep = "&";
    }
  }
  if (_have_show_deleted_) {
    StrAppend(target, sep, "showDeleted=",
              client::CppValueToEscapedUrlValue(
                show_deleted_));
    sep = "&";
  }
  if (_have_show_hidden_invitations_) {
    StrAppend(target, sep, "showHiddenInvitations=",
              client::CppValueToEscapedUrlValue(
                show_hidden_invitations_));
    sep = "&";
  }
  if (_have_single_events_) {
    StrAppend(target, sep, "singleEvents=",
              client::CppValueToEscapedUrlValue(
                single_events_));
    sep = "&";
  }
  if (_have_sync_token_) {
    StrAppend(target, sep, "syncToken=",
              client::CppValueToEscapedUrlValue(
                sync_token_));
    sep = "&";
  }
  if (_have_time_max_) {
    StrAppend(target, sep, "timeMax=",
              client::CppValueToEscapedUrlValue(
                time_max_));
    sep = "&";
  }
  if (_have_time_min_) {
    StrAppend(target, sep, "timeMin=",
              client::CppValueToEscapedUrlValue(
                time_min_));
    sep = "&";
  }
  if (_have_time_zone_) {
    StrAppend(target, sep, "timeZone=",
              client::CppValueToEscapedUrlValue(
                time_zone_));
    sep = "&";
  }
  if (_have_updated_min_) {
    StrAppend(target, sep, "updatedMin=",
              client::CppValueToEscapedUrlValue(
                updated_min_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status EventsResource_WatchMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "calendarId") {
    client::UriTemplate::AppendValue(
        calendar_id_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
FreebusyResource_QueryMethod::FreebusyResource_QueryMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const FreeBusyRequest& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "freeBusy") {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
FreebusyResource_QueryMethod::~FreebusyResource_QueryMethod() {
}


// Standard constructor.
SettingsResource_GetMethod::SettingsResource_GetMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const StringPiece& setting)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "users/me/settings/{setting}"),
      setting_(setting.as_string()) {
}

// Standard destructor.
SettingsResource_GetMethod::~SettingsResource_GetMethod() {
}


util::Status SettingsResource_GetMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  if (variable_name == "setting") {
    client::UriTemplate::AppendValue(
        setting_, config, target);
    return client::StatusOk();
  }
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
SettingsResource_ListMethod::SettingsResource_ListMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::GET,
        "users/me/settings"),
      _have_max_results_(false),
      _have_page_token_(false),
      _have_sync_token_(false) {
}

// Standard destructor.
SettingsResource_ListMethod::~SettingsResource_ListMethod() {
}

util::Status SettingsResource_ListMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_sync_token_) {
    StrAppend(target, sep, "syncToken=",
              client::CppValueToEscapedUrlValue(
                sync_token_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status SettingsResource_ListMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}


// Standard constructor.
SettingsResource_WatchMethod::SettingsResource_WatchMethod(
    const CalendarService* _service_, client::AuthorizationCredential* _credential_, const Channel& __request_content__)
    : CalendarServiceBaseRequest(
        _service_, _credential_,
        client::HttpRequest::POST,
        "users/me/settings/watch"),
      _have_max_results_(false),
      _have_page_token_(false),
      _have_sync_token_(false) {
  AddJsonContentToRequest(&__request_content__);
}

// Standard destructor.
SettingsResource_WatchMethod::~SettingsResource_WatchMethod() {
}

util::Status SettingsResource_WatchMethod::AppendOptionalQueryParameters(string* target) {
  const char* sep = (target->find('?') == string::npos) ? "?" : "&";
  if (_have_max_results_) {
    StrAppend(target, sep, "maxResults=",
              client::CppValueToEscapedUrlValue(
                max_results_));
    sep = "&";
  }
  if (_have_page_token_) {
    StrAppend(target, sep, "pageToken=",
              client::CppValueToEscapedUrlValue(
                page_token_));
    sep = "&";
  }
  if (_have_sync_token_) {
    StrAppend(target, sep, "syncToken=",
              client::CppValueToEscapedUrlValue(
                sync_token_));
    sep = "&";
  }
  return CalendarServiceBaseRequest::AppendOptionalQueryParameters(target);
}
util::Status SettingsResource_WatchMethod::AppendVariable(
        const string& variable_name,
        const client::UriTemplateConfig& config,
        string* target) {
  return CalendarServiceBaseRequest::AppendVariable(
      variable_name, config, target);
}



CalendarService::CalendarService(client::HttpTransport* transport)
  : ClientService("https://www.googleapis.com/", "calendar/v3/", transport), acl_(this), calendar_list_(this), calendars_(this), channels_(this), colors_(this), events_(this), freebusy_(this), settings_(this) {
  this->SetBatchPath("batch/calendar/v3");
}

CalendarService::~CalendarService() {
}


CalendarService::AclResource::AclResource(CalendarService* service)
  : service_(service) {
}



AclResource_DeleteMethod* CalendarService::AclResource::NewDeleteMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& rule_id) const {
  return new AclResource_DeleteMethod(service_, _credential_, calendar_id, rule_id);
}


AclResource_GetMethod* CalendarService::AclResource::NewGetMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& rule_id) const {
  return new AclResource_GetMethod(service_, _credential_, calendar_id, rule_id);
}


AclResource_InsertMethod* CalendarService::AclResource::NewInsertMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const AclRule& __request_content__) const {
  return new AclResource_InsertMethod(service_, _credential_, calendar_id, __request_content__);
}


AclResource_ListMethod* CalendarService::AclResource::NewListMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new AclResource_ListMethod(service_, _credential_, calendar_id);
}


AclResource_ListMethodPager* CalendarService::AclResource::NewListMethodPager(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new client::EncapsulatedServiceRequestPager<AclResource_ListMethod, Acl>(new AclResource_ListMethod(service_, _credential_, calendar_id));
}


AclResource_PatchMethod* CalendarService::AclResource::NewPatchMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& rule_id, const AclRule& __request_content__) const {
  return new AclResource_PatchMethod(service_, _credential_, calendar_id, rule_id, __request_content__);
}


AclResource_UpdateMethod* CalendarService::AclResource::NewUpdateMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& rule_id, const AclRule& __request_content__) const {
  return new AclResource_UpdateMethod(service_, _credential_, calendar_id, rule_id, __request_content__);
}


AclResource_WatchMethod* CalendarService::AclResource::NewWatchMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Channel& __request_content__) const {
  return new AclResource_WatchMethod(service_, _credential_, calendar_id, __request_content__);
}

CalendarService::CalendarListResource::CalendarListResource(CalendarService* service)
  : service_(service) {
}



CalendarListResource_DeleteMethod* CalendarService::CalendarListResource::NewDeleteMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new CalendarListResource_DeleteMethod(service_, _credential_, calendar_id);
}


CalendarListResource_GetMethod* CalendarService::CalendarListResource::NewGetMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new CalendarListResource_GetMethod(service_, _credential_, calendar_id);
}


CalendarListResource_InsertMethod* CalendarService::CalendarListResource::NewInsertMethod(client::AuthorizationCredential* _credential_, const CalendarListEntry& __request_content__) const {
  return new CalendarListResource_InsertMethod(service_, _credential_, __request_content__);
}


CalendarListResource_ListMethod* CalendarService::CalendarListResource::NewListMethod(client::AuthorizationCredential* _credential_) const {
  return new CalendarListResource_ListMethod(service_, _credential_);
}


CalendarListResource_ListMethodPager* CalendarService::CalendarListResource::NewListMethodPager(client::AuthorizationCredential* _credential_) const {
  return new client::EncapsulatedServiceRequestPager<CalendarListResource_ListMethod, CalendarList>(new CalendarListResource_ListMethod(service_, _credential_));
}


CalendarListResource_PatchMethod* CalendarService::CalendarListResource::NewPatchMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const CalendarListEntry& __request_content__) const {
  return new CalendarListResource_PatchMethod(service_, _credential_, calendar_id, __request_content__);
}


CalendarListResource_UpdateMethod* CalendarService::CalendarListResource::NewUpdateMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const CalendarListEntry& __request_content__) const {
  return new CalendarListResource_UpdateMethod(service_, _credential_, calendar_id, __request_content__);
}


CalendarListResource_WatchMethod* CalendarService::CalendarListResource::NewWatchMethod(client::AuthorizationCredential* _credential_, const Channel& __request_content__) const {
  return new CalendarListResource_WatchMethod(service_, _credential_, __request_content__);
}

CalendarService::CalendarsResource::CalendarsResource(CalendarService* service)
  : service_(service) {
}



CalendarsResource_ClearMethod* CalendarService::CalendarsResource::NewClearMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new CalendarsResource_ClearMethod(service_, _credential_, calendar_id);
}


CalendarsResource_DeleteMethod* CalendarService::CalendarsResource::NewDeleteMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new CalendarsResource_DeleteMethod(service_, _credential_, calendar_id);
}


CalendarsResource_GetMethod* CalendarService::CalendarsResource::NewGetMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new CalendarsResource_GetMethod(service_, _credential_, calendar_id);
}


CalendarsResource_InsertMethod* CalendarService::CalendarsResource::NewInsertMethod(client::AuthorizationCredential* _credential_, const Calendar& __request_content__) const {
  return new CalendarsResource_InsertMethod(service_, _credential_, __request_content__);
}


CalendarsResource_PatchMethod* CalendarService::CalendarsResource::NewPatchMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Calendar& __request_content__) const {
  return new CalendarsResource_PatchMethod(service_, _credential_, calendar_id, __request_content__);
}


CalendarsResource_UpdateMethod* CalendarService::CalendarsResource::NewUpdateMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Calendar& __request_content__) const {
  return new CalendarsResource_UpdateMethod(service_, _credential_, calendar_id, __request_content__);
}

CalendarService::ChannelsResource::ChannelsResource(CalendarService* service)
  : service_(service) {
}



ChannelsResource_StopMethod* CalendarService::ChannelsResource::NewStopMethod(client::AuthorizationCredential* _credential_, const Channel& __request_content__) const {
  return new ChannelsResource_StopMethod(service_, _credential_, __request_content__);
}

CalendarService::ColorsResource::ColorsResource(CalendarService* service)
  : service_(service) {
}



ColorsResource_GetMethod* CalendarService::ColorsResource::NewGetMethod(client::AuthorizationCredential* _credential_) const {
  return new ColorsResource_GetMethod(service_, _credential_);
}

CalendarService::EventsResource::EventsResource(CalendarService* service)
  : service_(service) {
}



EventsResource_DeleteMethod* CalendarService::EventsResource::NewDeleteMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id) const {
  return new EventsResource_DeleteMethod(service_, _credential_, calendar_id, event_id);
}


EventsResource_GetMethod* CalendarService::EventsResource::NewGetMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id) const {
  return new EventsResource_GetMethod(service_, _credential_, calendar_id, event_id);
}


EventsResource_ImportMethod* CalendarService::EventsResource::NewImportMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Event& __request_content__) const {
  return new EventsResource_ImportMethod(service_, _credential_, calendar_id, __request_content__);
}


EventsResource_InsertMethod* CalendarService::EventsResource::NewInsertMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Event& __request_content__) const {
  return new EventsResource_InsertMethod(service_, _credential_, calendar_id, __request_content__);
}


EventsResource_InstancesMethod* CalendarService::EventsResource::NewInstancesMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id) const {
  return new EventsResource_InstancesMethod(service_, _credential_, calendar_id, event_id);
}


EventsResource_InstancesMethodPager* CalendarService::EventsResource::NewInstancesMethodPager(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id) const {
  return new client::EncapsulatedServiceRequestPager<EventsResource_InstancesMethod, Events>(new EventsResource_InstancesMethod(service_, _credential_, calendar_id, event_id));
}


EventsResource_ListMethod* CalendarService::EventsResource::NewListMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new EventsResource_ListMethod(service_, _credential_, calendar_id);
}


EventsResource_ListMethodPager* CalendarService::EventsResource::NewListMethodPager(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id) const {
  return new client::EncapsulatedServiceRequestPager<EventsResource_ListMethod, Events>(new EventsResource_ListMethod(service_, _credential_, calendar_id));
}


EventsResource_MoveMethod* CalendarService::EventsResource::NewMoveMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id, const StringPiece& destination) const {
  return new EventsResource_MoveMethod(service_, _credential_, calendar_id, event_id, destination);
}


EventsResource_PatchMethod* CalendarService::EventsResource::NewPatchMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id, const Event& __request_content__) const {
  return new EventsResource_PatchMethod(service_, _credential_, calendar_id, event_id, __request_content__);
}


EventsResource_QuickAddMethod* CalendarService::EventsResource::NewQuickAddMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& text) const {
  return new EventsResource_QuickAddMethod(service_, _credential_, calendar_id, text);
}


EventsResource_UpdateMethod* CalendarService::EventsResource::NewUpdateMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const StringPiece& event_id, const Event& __request_content__) const {
  return new EventsResource_UpdateMethod(service_, _credential_, calendar_id, event_id, __request_content__);
}


EventsResource_WatchMethod* CalendarService::EventsResource::NewWatchMethod(client::AuthorizationCredential* _credential_, const StringPiece& calendar_id, const Channel& __request_content__) const {
  return new EventsResource_WatchMethod(service_, _credential_, calendar_id, __request_content__);
}

CalendarService::FreebusyResource::FreebusyResource(CalendarService* service)
  : service_(service) {
}



FreebusyResource_QueryMethod* CalendarService::FreebusyResource::NewQueryMethod(client::AuthorizationCredential* _credential_, const FreeBusyRequest& __request_content__) const {
  return new FreebusyResource_QueryMethod(service_, _credential_, __request_content__);
}

CalendarService::SettingsResource::SettingsResource(CalendarService* service)
  : service_(service) {
}



SettingsResource_GetMethod* CalendarService::SettingsResource::NewGetMethod(client::AuthorizationCredential* _credential_, const StringPiece& setting) const {
  return new SettingsResource_GetMethod(service_, _credential_, setting);
}


SettingsResource_ListMethod* CalendarService::SettingsResource::NewListMethod(client::AuthorizationCredential* _credential_) const {
  return new SettingsResource_ListMethod(service_, _credential_);
}


SettingsResource_ListMethodPager* CalendarService::SettingsResource::NewListMethodPager(client::AuthorizationCredential* _credential_) const {
  return new client::EncapsulatedServiceRequestPager<SettingsResource_ListMethod, Settings>(new SettingsResource_ListMethod(service_, _credential_));
}


SettingsResource_WatchMethod* CalendarService::SettingsResource::NewWatchMethod(client::AuthorizationCredential* _credential_, const Channel& __request_content__) const {
  return new SettingsResource_WatchMethod(service_, _credential_, __request_content__);
}
}  // namespace google_calendar_api
